
#ifndef __STACK_H_  
#define __STACK_H_  
#include <stdio.h> 
#include <stdlib.h>
#define ERROR_CHECK(ret, num, msg)     {                                      if (ret == num)                    {                                      perror(msg);                    exit(1);                      }                              } 
typedef char type;
typedef struct stack
{
    type *data;//指向数据域的指针
    int data_size;
    int top;//top
}ST;
/**
 * @brief Create a Stack object
 * 
 * @return ST* 
 */
ST * createStack();
/**
 * @brief 
 * 
 * @param stack 
 * @param val 
 */
void pushStack(ST *stack,type val);
/**
 * @brief 
 * 
 * @param stack 
 * @return type popVal
 */
type popStack(ST *stack);

/**
 * @brief 
 * 
 * @param stack 
 */
void clearStack(ST *stack);


/**
 * @brief 
 * 
 * @param stack 
 * @return int 0(空)
 */
int isEmpty(ST* stack);
#endif
